package com.wits.qso.dao.impl;

import javax.persistence.Query;

import com.wits.platform.dao.impl.BaseDaoImpl;
import com.wits.qso.dao.custom.CroomDaoCustom;
import com.wits.qso.entity.Croom;

public class CroomDaoImpl extends BaseDaoImpl<Croom, String> implements CroomDaoCustom{

	public Croom findByTitleAndCode(String title, String code) {
		Croom result = null;
		
		try {
			Query query = em.createQuery( "FROM Croom o WHERE o.crmTitle = :title AND o.crmCode = :code" );
			query.setParameter( "title", title );
			query.setParameter( "code", code );
			
			result = (Croom) query.getSingleResult();
		} catch (Throwable cause) {}
		
		return result;
	}
}
